package com.nbsaas.boot.agent.rest.resource;

import com.nbsaas.boot.agent.api.apis.AgentModelApi;
import com.nbsaas.boot.entity.agent.AgentModel;
import com.nbsaas.boot.agent.api.domain.request.AgentModelRequest;
import com.nbsaas.boot.agent.api.domain.response.AgentModelResponse;
import com.nbsaas.boot.agent.api.domain.simple.AgentModelSimple;
import com.nbsaas.boot.agent.rest.convert.AgentModelSimpleConvert;
import com.nbsaas.boot.agent.rest.convert.AgentModelEntityConvert;
import com.nbsaas.boot.agent.rest.convert.AgentModelResponseConvert;
import com.nbsaas.boot.agent.data.repository.AgentModelRepository;

import java.io.Serializable;
import com.nbsaas.boot.jpa.data.core.BaseResource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import jakarta.annotation.Resource;
import org.springframework.data.jpa.repository.support.JpaRepositoryImplementation;

import java.util.function.Function;
/**
*   -业务接口实现
*/
@Transactional
@Service
public class AgentModelResource extends BaseResource<AgentModel,AgentModelResponse, AgentModelSimple, AgentModelRequest>  implements AgentModelApi {

    @Resource
    private AgentModelRepository agentModelRepository;

    @Override
    public JpaRepositoryImplementation<AgentModel, Serializable> getJpaRepository() {
        return agentModelRepository;
    }

    @Override
    public Function<AgentModel, AgentModelSimple> getConvertSimple() {
        return new AgentModelSimpleConvert();
    }

    @Override
    public Function<AgentModelRequest, AgentModel> getConvertForm() {
        return new AgentModelEntityConvert();
    }

    @Override
    public Function<AgentModel, AgentModelResponse> getConvertResponse() {
        return new AgentModelResponseConvert();
    }




}


